package com.example.condition;

import com.example.condition.condition.LinuxCondition;
import com.example.condition.condition.WindowCondition;
import com.example.condition.service.LinuxShowCmdService;
import com.example.condition.service.ShowCmdService;
import com.example.condition.service.WindowShowCmdService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConditionConfig {


    @Bean
    @Conditional(WindowCondition.class)
    public ShowCmdService windowsShowCmdService() {
        return new WindowShowCmdService();
    }


    @Bean
    @Conditional(LinuxCondition.class)
    public ShowCmdService linuxShowCmdService() {
        return new LinuxShowCmdService();
    }
}
